<div class="content">
<script type="text/javascript" language="javascript" charset="utf-8">
    document.onkeydown = register;
function nextSiblingElement(elem) {
                 do {
                 elem = elem.nextSibling;
                 } while (elem && elem.nodeType != 1);
                 return elem;
        }
function register(e) {
    if (!e) e = window.event;
        var k = e.keyCode;
    //if (e.altKey && e.ctrlKey) {
        d=null
        if (k == 37) {
            d = document.getElementById('diafilm_next_prev').firstChild;
            if (d.nodeType!=1) d=d.nextSibling;
        }
        if (k == 39) {
            d = document.getElementById('diafilm_next_prev').firstChild;
            if (d.nodeType!=1) d=d.nextSibling;
            d = d.nextSibling;
            if (d.nodeType!=1) d=d.nextSibling;
        }
        if (d && d!=null && d.tagName=="A") location.href = d.href;
  //  }
}
</script>
<%=render :partial=>"breadcrumb"%>
<div class="diafilm_navigation_bar">
<% if @num_ph > 1 %>
    <div class="diafilm_thumb">
    <% image = image_tag(@photos[@num_ph-2].to_url(:thumbnail), :id=>"photo_#{@photos[@num_ph-1].id}",   :title=>@photos[@num_ph-2].title) %>
    <%= link_to image, :action=>"tag", :id=>params[:id], :photo=>@num_ph-2%>
    </div>
   <% else %>
    <div class="diafilm_thumb"><%= image_tag("/stylesheets/"+get_scheme+"/images/blank.gif", :width=>"100", :height=>"100", :style=>"border:none;") %></div>
   <% end %>

   <% if @num_ph > 0 %>
   <div class="diafilm_thumb">
    <% image = image_tag(@photos[@num_ph-1].to_url(:thumbnail), :id=>"photo_#{@photos[@num_ph-1].id}", :title=>@photos[@num_ph-1].title) %>
    <%= link_to image,  :action=>"tag", :id=>params[:id], :photo=>@num_ph-1 %>
    </div>
   <% else %>
    <div class="diafilm_thumb"><%= image_tag("/stylesheets/"+get_scheme+"/images/blank.gif", :width=>"100", :height=>"100", :style=>"border:none;") %></div>
   <% end %>
   <div class="diafilm_thumb">
   <img class="list-image" src="<%= @photos[@num_ph].to_url(:thumbnail) %>" BORDER=5 STYLE="border-color:gold"/>
   </div>
   <% if @num_ph <  @photos.size-1 %>
   <div class="diafilm_thumb">
    <% image = image_tag(@photos[@num_ph+1].to_url(:thumbnail), :id=>"photo_#{@photos[@num_ph+1].id}",  :title=>@photos[@num_ph+1].title) %>
    <%= link_to image,  :action=>"tag", :id=>params[:id], :photo=>@num_ph+1%>
    </div>
   <% else %>
    <div class="diafilm_thumb"><%= image_tag("/stylesheets/"+get_scheme+"/images/blank.gif", :width=>"100", :height=>"100", :style=>"border:none;") %></div>
   <% end %>
   <% if @num_ph <  @photos.size-2 %>
   <div class="diafilm_thumb">
    <% image = image_tag(@photos[@num_ph+2].to_url(:thumbnail), :id=>"photo_#{@photos[@num_ph+2].id}", :title=>@photos[@num_ph+2].title) %>
    <%= link_to image,  :action=>"tag", :id=>params[:id], :photo=>@num_ph-2 %>
    </div>
   <% else %>
    <div class="diafilm_thumb"><%= image_tag("/stylesheets/"+get_scheme+"/images/blank.gif", :width=>"100", :height=>"100", :style=>"border:none;") %></div>
   <% end %>
</div>
<br>     <br>
<div id="diafilm_next_prev">
   <% if @num_ph > 0 %>
     <%= link_to(image_tag("/stylesheets/"+get_scheme+"/images/Prev"), :controller=>"view", :action=>"tag", :id=>params[:id], :photo=>@num_ph-1) %>
   <% else %>
     <%= image_tag("/stylesheets/"+get_scheme+"/images/Prev_em") %>
   <% end %>
   <% if @num_ph < @photos.size-1  %>
     <%= link_to(image_tag("/stylesheets/"+get_scheme+"/images/Next"), :controller=>"view", :action=>"tag", :id=>params[:id], :photo=>@num_ph+1) %>
   <% else %>
     <%= image_tag("/stylesheets/"+get_scheme+"/images/Next_em") %>
   <% end %>
   </div>
   <br>
   <div class="diafilm_photo">
     <% rel = logged_in? ? "nil" : "lightbox" %>
	 <% k = @al.title %>
     <% url = logged_in? ? "#" : image_path(@photos[@num_ph].to_url_or(k)) %>
     <% image = image_tag(@photos[@num_ph].to_url(:large), :id=>"photo_#{@photos[@num_ph].id}", :title=>@photos[@num_ph].title) %>
     <%= link_to image, url, :rel=>rel %>
     <%= draggable_element "photo_#{@num_ph}", :revert => true if logged_in? %>
   </div>
</div>